/// 旅游搜索
class TravelSearchModel {
  late String keyword;
  ResponseStatus? responseStatus;
  List<Result>? result;

  TravelSearchModel({required this.responseStatus, required this.result});

  TravelSearchModel.fromJson(Map<String, dynamic> json) {
    responseStatus = json['ResponseStatus'] != null
        ? new ResponseStatus.fromJson(json['ResponseStatus'])
        : null;
    if (json['result'] != null) {
      result = [];
      json['result'].forEach((v) {
        result!.add(Result.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.responseStatus != null) {
      data['ResponseStatus'] = this.responseStatus!.toJson();
    }
    if (this.result != null) {
      data['result'] = this.result!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

/// 响应状态
class ResponseStatus {
  late String timestamp;
  late String ack;
  late List<Extension> extension;

  ResponseStatus({required this.timestamp, required this.ack, required this.extension});

  ResponseStatus.fromJson(Map<String, dynamic> json) {
    timestamp = json['Timestamp'];
    ack = json['Ack'];
    if (json['Extension'] != null) {
      extension = [];
      json['Extension'].forEach((v) {
        extension.add(new Extension.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['Timestamp'] = this.timestamp;
    data['Ack'] = this.ack;
    if (this.extension != null) {
      data['Extension'] = this.extension.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

/// 扩展
class Extension {
  late String id;
  late String value;

  Extension({required this.id, required this.value});

  Extension.fromJson(Map<String, dynamic> json) {
    id = json['Id'];
    value = json['Value'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['Id'] = this.id;
    data['Value'] = this.value;
    return data;
  }
}

/// 结果
class Result {
  late String moduleType;
  late List<Items> items;

  Result({required this.moduleType, required this.items});

  Result.fromJson(Map<String, dynamic> json) {
    moduleType = json['moduleType'];
    if (json['items'] != null) {
      items = [];
      json['items'].forEach((v) {
        items.add(new Items.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['moduleType'] = this.moduleType;
    if (this.items != null) {
      data['items'] = this.items.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Items {
  late int id;
  late String resourceType;
  late String name;
  late String title;
  late String appUrl;
  late String h5Url;
  late String wxUrl;
  late String mainWxUrl;
  late String imageUrl;
  late String clientAuth;
  late int followCount;
  late int articleCount;

  Items(
      {required this.id,
      required this.resourceType,
      required this.name,
      required this.title,
      required this.appUrl,
      required this.h5Url,
      required this.wxUrl,
      required this.mainWxUrl,
      required this.followCount,
      required this.imageUrl,
      required this.clientAuth,
      required this.articleCount});

  Items.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    resourceType = json['resourceType'];
    name = json['name'];
    title = json['title'];
    appUrl = json['appUrl'];
    h5Url = json['h5Url'];
    wxUrl = json['wxUrl'];
    mainWxUrl = json['mainWxUrl'];
    imageUrl = json['imageUrl'];
    clientAuth = json['clientAuth'];
    followCount = json['followCount'];
    articleCount = json['articleCount'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['resourceType'] = this.resourceType;
    data['name'] = this.name;
    data['title'] = this.title;
    data['appUrl'] = this.appUrl;
    data['h5Url'] = this.h5Url;
    data['wxUrl'] = this.wxUrl;
    data['mainWxUrl'] = this.mainWxUrl;
    data['followCount'] = this.followCount;
    data['clientAuth'] = this.clientAuth;
    data['imageUrl'] = this.imageUrl;
    data['articleCount'] = this.articleCount;
    return data;
  }
}
